#ifndef GAME_H
#define GAME_H

#define Id int;

#define ACTION_TYPE_DESTROY 1
#define ACTION_TYPE_MOVE 2
#define ACTION_TYPE_CREATE 3
#define ACTION_TYPE_VISUALISE 4

#define STATE_SELF 1
#define STATE_ALLY 2
#define STATE_ENEMY 3
#define STATE_NEUTRAL 4


class TAction {
 public:
  long time;
  int action;
  char* parameters;
};

typedef std::list <TAction*> TActionList;

class TPlayer {
 public:
  char id;
  char state; //ally/enemy
  int evil; //amount of evil
};

class TUnit {
 public:
  long x, y;//just a getter
  void move(long int target_x, long int target_y); //instant move to location
  TPlayer* owner;
  char type;
  TUnit(long x, long y, char type);
 private:
  long real_x, real_y;
};

class TBuilding {
 public:
  long x, y;//just a getter
  char type;
  std::string name;
 private:
  long real_x, real_y;
};

typedef map <int, TUnit> TUnitMap {
	TUnit get_unit(Id unit_id);
	list <TUnit> get_units(TArea area);
	list <TUnit> get_units(Id player);
	list <TUnit> get_units(char type);
	TUnitMap operator | (TUnitMap & other_map);
	void operator |= (TUnitMap & other_map);
	TUnitMap operator & (TUnitMap & other_map);
	void operator &= (TUnitMap & other_map);
}
#endif
